﻿using AspNetCore.Host.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;


var builder = WebApplication.CreateBuilder();
builder.Logging.AddDebug();
builder.Services.PostConfigure<KestrelOptions>(c =>
{
    c.Url = "http://127.0.0.1:8080";
    c.RequestBodyMaxSize = 1024 * 1024;
});

//配置容器服务
var app = builder.Build();
app.UseExceptionHandler();


app.Use(async (context,next) =>
{
    var end = context.GetEndpoint();
    Console.WriteLine("222");
    await next();
    Console.WriteLine("222");
});

app.MapControllers();

//负责执行匹配的终结点
//吧endpoint注册到EndpointDataSource

app.Run();